<?php
function checkProxy($pip,$pport,$url,$pusr='',$ppass='')
{
	if($pport == '')
		$pport = 3128;

	$proxy = $pip.":".$pport;

	$ch = curl_init();
	curl_setopt($ch, CURLOPT_URL,$url);
	curl_setopt($ch, CURLOPT_PROXY, $proxy);
	if($pusr != '')
	{
		$proxyauth = $pusr.":".$ppass;
		curl_setopt($ch, CURLOPT_PROXYUSERPWD, $proxyauth);
	}
	curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
	curl_setopt($ch, CURLOPT_HEADER, 1);
	$curl_scraped_page = curl_exec($ch);
	curl_close($ch);
	if ($content === false)
	{
		echo "Connect failed! Error <br />";
		echo $curl_scraped_page;
    }
	else
	{
		echo "Connect Success! Screenshot: <br />";
		echo $curl_scraped_page;
	}

}

?>